<div id="news">
	<ul>
		<li><a href="#tabs-friends"><?php echo __("Friends")?></a></li>
		<li><a href="#tabs-photos"><?php echo __("Photos")?></a></li>
	</ul>
	<div id="tabs-friends">
		<ul class="normal-list">
		<?php
		if($news->count() > 0)
		{
			foreach($sf_data->getRaw('news') as $activity){?>
			<li style="clear:left;">
				<img style="float:left;" src="core.php/photo/thumbnail/id/<?php $activity['photo_id']; ?>/type/mini" />
				<ul class="normal-list" style="float:left;">
					<li style="margin-top:0"><a class="ui-state-default ui-corner-all" href="#profile/load/id/<?php echo $activity['id']; ?>" style="text-decoration:none;"><?php echo $activity['title']; ?></a></li>
					<?php foreach($activity['events'] as $event){
					if($event['extra'] != "")
						$extra = $event['extra'];
					else
						$extra = "";?>
					<li style="margin-top:0; width:500px;"><span class="icon ui-icon ui-icon-<?php echo $event['icon']; ?>"></span><a href="#<?php echo $event['url'];?>/load/id/<?php echo $event['id'];?>" style="text-decoration:none;"><?php echo $event['content'];?></a><?php echo $extra;?></li>
					<?php } ?>
				</ul>
				
				<div style="float:right"><?php
				if($activity['time'] < 86400){
					$number = $activity['time'];
					$index = 0;
					while($number>60){
						$index++;
						$number=floor($number/60);
					}
					if($index == 0){
						//Seconds
						$timeType = $number==1?__("second"):__("seconds");
					}elseif($index == 1){
						//Minutes
						$timeType = $number==1?__("minute"):__("minutes");
					}else
						$timeType = $number==1?__("hour"):__("hours");
					echo __('%1% %2% ago', array('%1%' => $number,'%2%'=>$timeType));
				}else{
					$number = floor($activity['time']/86400);
					$timeType = $number==1?__("day"):__("days");
					echo __('More than %1% %2% ago', array('%1%' => $number,'%2%'=>$timeType));
				}
					?></div>
			</li>
			<?php }
		}else{
			echo "<li>".__("You does not have any recent activity")."</li>";
		} ?>
		</ul>
	</div>
	<div id="tabs-photos"></div>
</div>
